From: Ian Jackson Date: Mon, 12 Dec 2011 17:48:39 +0000 (+0000) Subject: libxl: permit declaration after statement X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/%22bookmarks://%22Dat/%22http:/www.example.com/cgi/%22https:/%22bookmarks:/%22Dat?a=commitdiff_plain;h=e66ba879d163f9e58eca843f4669616cc49c2f66;p=xen.git libxl: permit declaration after statement GCC and C99 allow declarations to be mixed with code. This is a good idea because: * It allows variables to be more often initialised as they are declared, thus reducing the occurrence of uninitialised variable errors. * Certain alloca-like constructs (arrays allocated at runtime on the stack) can more often be written without a spurious { } block. Such blocks are confusing to read. * It makes it easier to write and use macros which declare and initialise formulaic variables and do other function setup code, because there is no need to worry that such macros might be incompatible with each other or have strict ordering constraints. Signed-off-by: Ian Jackson Acked-by: Ian Campbell Committed-by: Ian Jackson --- diff --git a/tools/libxl/Makefile b/tools/libxl/Makefile index 7a0c03c7bb..70c9c1cfe9 100644 --- a/tools/libxl/Makefile +++ b/tools/libxl/Makefile @@ -11,7 +11,8 @@ MINOR = 0 XLUMAJOR = 1.0 XLUMINOR = 0 -CFLAGS += -Werror -Wno-format-zero-length -Wmissing-declarations +CFLAGS += -Werror -Wno-format-zero-length -Wmissing-declarations \ + -Wno-declaration-after-statement CFLAGS += -I. -fPIC ifeq ($(CONFIG_Linux),y)